package com.situ.day6;

import com.situ.day5.Person;
import org.junit.Test;

public class OOPDemo {
    @Test
    public void test33() {
        Person person = new Person();
        //'name' has protected access in 'com.situ.day5.Person'
        //person.name = "zhang";
    }

    @Test
    public void test44() {
        System.out.println(Integer.MAX_VALUE);

        //自动装箱
        //Integer integer = new Integer(4);
        Integer integer = 4;
        int i = integer.intValue();

        int num = 5;
        num = num + 3;

        //自动拆箱
        //integer.intValue()
        integer = integer + 3;
        System.out.println(integer);//7
    }

    @Test
    public void test55() {
        //把基本数据类型转换成字符串
        String str1 = 12 + "";
        String str2 = Integer.toString(13); // "13"

        //把字符串转换成基本数据类型  "23"
        int i = Integer.parseInt("23"); // 23

        Integer integer = new Integer("24");
        int i1 = integer.intValue();

        //"3.14"
        double d = Double.parseDouble("3.14");
        //"true"
        boolean b = Boolean.parseBoolean("true");

    }
}
